import request from '@/router/axios';
import { baseUrl } from '@/config/env';
export const loginByUsername = (account, password, way, source) => {
    return request({
        url: baseUrl + '/v1/auth/login/',
        meta: {
            isToken: false,
        },
        method: 'post',
        data: { account, password, way, source}
    })
}

export const getUserInfo = () => request({
    url: baseUrl + '/user/getUserInfo',
    method: 'get'
});

export const refeshToken = () => request({
    url: baseUrl + '/user/refesh',
    method: 'post'
})

export const getMenu = (type = 0) => request({
    url: baseUrl + '/v1/auth/getMenu/',
    method: 'get',
    data: {
        type
    }
});

export const getTopMenu = () => request({
    url: '/user/getTopMenu',
    method: 'get'
});

export const sendLogs = (list) => request({
    url: baseUrl + '/user/logout',
    method: 'post',
    data: list
})

export const logout = () => request({
    url: '/user/logout',
    meta: {
        isToken: false
    },
    method: 'get'
})